import { Controller, Post, Body, Get, Param } from '@nestjs/common'
import { ComfyService } from './comfy.service'

@Controller('comfy')
export class ComfyController {
    constructor(private readonly comfyService: ComfyService) { }

    @Post('generate')
    async generate(@Body() params: any) {
        const taskId = await this.comfyService.startGeneration(params)
        return { taskId }
    }

    @Post('workflows')
    async saveWorkflow(@Body() workflow: any) {
        const result = await this.comfyService.saveWorkflow(workflow)
        return result
    }

    @Get('workflows/:id')
    async getWorkflow(@Param('id') id: string) {
        return this.comfyService.getWorkflow(id)
    }
} 